const playyerAction= process.argv[process.argv.length-1];
console.log(playyerAction)
if(playyerAction!=='rock'&&playyerAction!=='paper'&&playyerAction!=='scissors'){
    console.log('请输入rock、paper、scissor')
}else{
    const arr=['rock','paper','scissors']
    const index=Math.floor(Math.random()*3)
    const computerAction=arr[index]
    console.log('你出的是：'+playyerAction)
    console.log('电脑出的是：'+computerAction)
    if(playyerAction===computerAction){
        console.log('平局')
    }
    else if(
        playyerAction=='rock'&&computerAction=='paper'||
        playyerAction=='paper'&&computerAction=='scissors'||
        playyerAction=='scissors'&&computerAction=='rock'
    ){
        console.log('你赢了')
    }
    else{
        console.log('你输了')
    }
    
}
